# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-image-editor
pkgver=1.0.26
pkgrel=1
pkgdesc='Public library for deepin-image-viewer and deepin-album'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/image-editor"
license=('GPL3')
depends=('dtkwidget' 'ffmpegthumbnailer' 'freeimage' 'libmediainfo' 'opencv')
makedepends=('cmake' 'ninja' 'qt5-tools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/linuxdeepin/image-editor/archive/$pkgver.tar.gz"
        remove-broken-flags.patch)
sha512sums=('d987e0aef933fc04a634f7564a8229c8f0a1e81307232f321a3626f629aeb4115c4d5b52b242bffb09b33691946d67f30697a10f88850efae56c3eccce0f3570'
            'bc72e7732ae045a10129336a770d04827c487fb57938c4711e57aeeccde369fca207913477a695cddffc7d0fb6d77add1f75b9b5ca784d0285b8f4f56c2376ad')

prepare() {
  patch -d image-editor-$pkgver -p2 < remove-broken-flags.patch
}

build() {
  cd image-editor-$pkgver
  cmake . -GNinja -DCMAKE_INSTALL_PREFIX=/usr
  ninja
}

package() {
  cd image-editor-$pkgver
  DESTDIR="$pkgdir" ninja install
}
